using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;

namespace GameEngine.Content
{
    public class GEObject
    {
        protected Vector3 position;
        protected Vector3 scale;
        protected Vector3 rotation;
        protected string Shader;

        public Vector3 Position { get { return position; } set { position = value; } }
        public Vector3 Scale { get { return scale; } set { scale = value; } }
        public Vector3 Rotation { get { return rotation; } set { rotation = value; } }

        public GEObject()
        {
            position = new Vector3(0, 0, 0);
            scale = new Vector3(1, 1, 1);
            rotation = new Vector3(0, 0, 0);
        }
        
        /// <summary>
        /// Draws the object
        /// </summary>
        /// <param name="device">The device to be drawn to</param>
        public void Draw(GraphicsDevice device)
        {
            if (this is IGERenderable)
            {
                ((IGERenderable)this).Render(device);
            }
        }

        /// <summary>
        /// Load the object's content
        /// </summary>
        /// <param name="content">The content manager to be used for loading</param>
        public void LoadContent(ContentManager content)
        {
            if (this is IGEHasContent) 
            {
                ((IGEHasContent)this).LoadContent(content);
            }
        }

        /// <summary>
        /// Set the object's shader
        /// </summary>
        /// <param name="shaderName">The name of the shader, as stored in GEShaderManager</param>
        public void SetShader(string shaderName)
        {
            Shader = shaderName;
        }
    }
}
